Color2Index
Color2Index Find the best possible color match
#include <Quickdraw.h> Color Manager
RGBColor *rgb ; requested color
returns the “reference constant” of a control
Color2Index uses the list of search procedures in the current device record
to come up with the closest possible match for a requested RGBColor.
rgb is the absolute color requested by the application
Returns: a 4-byte long; a padded pixel value filled out with zeros in the high
word.

Notes: Color2Index is a color conversion function that returns a padded pixel
value with zeros in the high word. Because the colorSpec.value field too
short by half, the low word of Color2Index's result is truncated to fit into
the colorSpec. The .value field of a PixMap would be the low-order word
of this index.
Don't have your application call this function from a custom search
procedure.